The present invention relates to a control method for computers, and more particularly to a method of running a plurality of operating systems (OSs) on a single computer.
A general computer runs only a single OS which manages computer resources such as a processor, a memory, and a secondary storage and performs resource scheduling in order to realize an efficient operation of the computer.
There are various types of OSs, some excellent in batch processing, some excellent in time sharing system (TSS), and some excellent in graphical user interface (GUI).
There are needs of using a plurality of OSs on a single computer. For example, a mainframe is desired to operate both OS for executing practical online transaction processings and OS for research and development. There is also a requirement for running both OS having comparative GUI and OS excellent in real time.
However, each OS is assumed to manage computer resources by itself and a concurrent presence of a plurality of OSs is impossible unless some measure is incorporated.
As a measure for operating a plurality of OSs on a single computer, a virtual machine system realized by a mainframe is known (refer to xe2x80x9cModern Operating Systemsxe2x80x9d: Andrew S. Tanenbaum, Prentice Hall, 1992 (pp. 21 to 22). In a virtual machine system, a virtual machine control program dominantly manages all hardware resources, and virtualizes these resources to configure the virtual machine system. A controller of a virtual machine system virtualizes physical memories, input/output (I/O) devices, external interrupts and the like.
For example, each divided physical memory is handled by each virtual machine as if it is a memory starting from the address xe2x80x9c0xe2x80x9d. Device numbers identifying I/O devices are similarly virtualized. In addition, a magnetic disk is also virtualized by dividing its memory area.
Each OS is scheduled by the control program so that OS runs on a virtual machine configured by the control program. However, in a virtual machine system of a mainframe, since computer resources are completely virtualized and divided, the controller of a virtual machine becomes complicated.
Setting a control register from an OS running on a virtual machine and a privilege instruction such as an I/O instruction issued by the OS, are required to be emulated by a virtual machine control program if there is no specific hardware support. A problem of a large overhead therefore occurs. In practice, this overhead is reduced in a mainframe which configures virtual machines, by adding hardware realizing processor functions and micro codes specific to the virtual machines. The virtual machine system aims at completely virtualizing computer resources, so that the system becomes complicated. Furthermore, to realize a high performance of a virtual machine, specific hardware is required.
A microkernel is know as techniques for providing a single computer with interface with a plurality of OSs (refer to xe2x80x9cModern Operating Systemsxe2x80x9d: Andrew S. Tanenbaum, Prentice Hall, 1992 (pp. 637 to 641). If a microkernel is used, an operating system server is configured on the microkernel, the server providing an OS function transparent to a user which utilizes computer resources via the server. If each OS is provided with such a server, a user is provided with various OS environments.
With the microkernel system, however, it is necessary to newly configure an operating system server compatible with a microkernel. In many cases, currently existing OSs are modified so as to run on the microkernel. The core portion of each OS such as scheduling and memory management is required to be modified. There are many portions to be modified. In addition, these modified portions are related also to the main part of each OS, so that the modification work is complicated and difficult.
Still further, although the operating system server utilizes services of the microkernel, this operation is not used by a general OS so that an overhead increases and the system performance is degraded.
In U.S. Pat. No. 5,721,922, a new scheduler is embedded in an OS interrupt handler to introduce a scheduling scheme without relying upon the original OS scheduler. However, in this case, an execution environment of the embedded scheduler is that of the original OS, and a task to be executed is defined by the original OS. This patent does not teach a method of sharing a plurality of OSs through division of resources such as I/O devices and through spatial division.
A conventional virtual machine system has relied upon a scheme of virtualizing all computer resources in order to run a plurality of OSs at the same time. This scheme is, however, associated with a problem of complicated control programs. In addition, this scheme requires emulation of privilege instructions so that specific hardware is necessary in order to retain the system performance.
It is an object of the present invention to provide a method and system capable of configuring a plurality of OSs with a relatively simple structure.
This invention realizes concurrent execution of a plurality of OSs without using specific hardware, by modifying an initializing process and interrupt management of each OS and by adding an interrupt management program. Since the invention does not require emulation of a privilege instruction, execution of each OS is not associated with a new overhead.
According to the invention, it is possible to readily add a function of supplementing a first OS under a second OS. Further, a function quite independent from the first OS can be embedded under the second OS, which is not possible by a device driver of the first OS. It is therefore possible to add a highly reliable function independent from the first OS. The invention is suitable for using a currently existing OS as the first OS.
According to the invention, modification of the first OS is limited only to an initializing process and interrupt management so that a multi-OS environment can be configured with ease.
According to the invention, the first OS reserves computer resources such as physical memories and external devices managed by the second OS, and a management program independent from both the first and second OSs captures an external interrupt issued from a computer resource. The management program determines from an interrupt factor which interrupt handler of one of the first and second OSs is activated, and also determines a timing of activating the interrupt handler in accordance with the execution state of the OS associated with the interrupt. The interrupt handler of each OS is activated in the above manner to run the two OSs on a single computer.